#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 30;

int num[N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    LL x, k;
    cin >> x >> k;

    int idx = 1;
    while(x){
        num[idx] = x % 10;
        x /= 10;
        idx ++;
    }

    for(int i = 1; i <= k; i ++){
        if(num[i] >= 5){
            num[i + 1] ++;
            int j = i + 1;
            while(num[j] == 10){
                num[j + 1] ++;
                num[j] = 0;
                j ++;
            }
            num[i] = 0;
        }else{
            num[i] = 0;
        }
    }


    

    int p = N - 1;
    while(num[p] == 0 && p >= 1) p --;
    if(p < 1){
        cout << 0;
        return 0;
    }

    for(int i = p; i >= 1; i --) cout << num[i];



    return 0;
}